CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)

SET(CMAKE_CXX_COMPILER "g++")

SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -g -Wall -O2 -D_FILE_OFFSET_BITS=64")

if (NOT GWLIB_DIR)
    set(GWLIB_DIR ${PROJECT_SOURCE_DIR}/../gwlib)
endif()
set(GWLIB_BUILD_DIR ${GWLIB_DIR}/build)

INCLUDE_DIRECTORIES(
    ${PROJECT_SOURCE_DIR}
    ${GWLIB_DIR}
    ${GWLIB_DIR}/gwlib
    )

LINK_DIRECTORIES(
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${GWLIB_BUILD_DIR}/lib
    )

add_executable(sur_mount
    common
    sur_mount
    sur_impls
    fuse_impls
    )

target_link_libraries(sur_mount
    gwlib_static gwbase_static 
    curl fuse pthread uuid)

install(TARGETS sur_mount DESTINATION bin)
install(FILES sur.conf DESTINATION share/dicom RENAME sur.conf.sample)
install(FILES README   DESTINATION share/dicom  RENAME sur_mount.readme)
